	function del() {
		art.dialog('artDialog: I Love You!', function () {alert('Thank you!')});
		return false;
	}
	
	//单项删除确认框
	function art_del_confirm(url,message){
		message = message?message:'你确定要删除这条数据吗？';
		art.dialog({
		    title: '确认删除',
		    okValue:'确认',
		    cancelValue:'取消',
		    width: 230,
		    height: 100,
		    fixed: true,
		    content: message,
		    ok: function () {
		    	 window.location.href=url; 
		        return true;
		    },
		    cancel: function () {
		    	return true;
		    }
		});
	}
	//单项处理确认框
	function alert_confirm(title,url,message){
		message = message?message:'你确定要删除这条数据吗？';
		art.dialog({
		    title: title,
		    okValue:'确认',
		    cancelValue:'取消',
		    width: 230,
		    height: 100,
		    fixed: true,
		    content: message,
		    ok: function () {
		    	 window.location.href=url; 
		        return true;
		    },
		    cancel: function () {
		    	return true;
		    }
		});
	}
	//通用提示框
	function alert_tips(title,message){
		title = title ? title : '';
		message = message ? message : '';
		art.dialog({
		    title: title,
			okValue:'确认',
		    width: 230,
		    height: 100,
		    fixed: true,
		    content: message,
			ok: function () {
		    	
			},
		});
	}
	//全选批操作
	function batch(url,message){
		if($('.chk:checked').length==0){
    		art.dialog({title: '错误',content: '所选项不能为空！'}).time(1000);
    		return;
		}
		
		art.dialog({
		    title: '批量操作',
		    okValue:'确认',
		    cancelValue:'取消',
		    width: 230,
		    height: 100,
		    fixed: true,
		    content: "<form id='art_dialog'  method='post' action='"+url+"' ><div class='updtitle'><p class='fs_14 jg' style='margin-top:10px;'>"+message+"</p><p id='proid'></p></div></form>",
		    ok: function () {
		        $("#art_dialog").submit();
		        return false;
		    },
		    cancel: function () {
		    	return true;
		    }
		});
	   var e = document.getElementsByName('id[]');	//alert(e.length)	;
	   for (var i=0; i<e.length; i++){
		   if(e[i].checked){
			   $('#art_dialog').append("<input type='hidden' name='ids[]' value='"+e[i].value+"' />");
		   }
		}
	}
	//分享
	function share(title,siteurl,content,sitetitle,imgurl,options) {
		art.dialog({
			title: '产品信息分享',
		    okValue:'确认',
		    cancelValue:'取消',
			fixed: true,
			content: "<div class='share'><div class='shares' id='ckepop'><span class='fenx f_l'>分享到：</span>"
				 +"<a href=http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title="+encodeURIComponent(title)+"&url="+encodeURIComponent(siteurl)+"&summary="+encodeURIComponent(content)+"&site="+encodeURIComponent(sitetitle)+"&pics="+encodeURIComponent(imgurl)+" title='分享到QQ空间'" +"class='jiathis_button_qzone'  target='_blank'><span class='jiathis_txt jtico jtico_qzone'></span></a>"
				 +"<a href=http://service.weibo.com/share/share.php?title="+encodeURIComponent(title)+"&url="+encodeURIComponent(siteurl)+"&appkey="+encodeURIComponent(sitetitle)+"&pic="+encodeURIComponent(imgurl)+" title='分享到新浪微博'"
				 +"class='jiathis_button_tsina'  target='_blank'><span class='jiathis_txt jtico jtico_tsina'></span></a>"
				 +"<a href=http://v.t.qq.com/share/share.php?url="+encodeURIComponent(siteurl)+"&title="+encodeURI(title)+"&appkey="+encodeURI(sitetitle)+"&pic="+encodeURI(imgurl)+"  title='分享到腾讯微博'"
				 +"class='jiathis_button_tqq'  target='_blank'><span class='jiathis_txt jtico jtico_tqq'></span></a>"
				 +"<a href=http://share.renren.com/share/buttonshare.do?link="+encodeURIComponent(siteurl)+"&title="+encodeURIComponent(title)+" title='分享到人人网'"
				 +" class='jiathis_button_renren'  target='_blank'><span class='jiathis_txt jtico jtico_renren'></span></a>"
				 +"<a href='http://www.kaixin001.com/repaste/bshare.php?rtitle="+encodeURIComponent(title)+"&rurl="+encodeURIComponent(siteurl)+"&rcontent="+encodeURIComponent(content)+"  title='分享到开心网'"
				 +" class='jiathis_button_kaixin001'  target='_blank'><span class='jiathis_txt jtico jtico_kaixin001'></span></a>"
				 +"<a href=http://t.sohu.com/third/post.jsp?url="+encodeURIComponent(siteurl)+"&title="+encodeURIComponent(title)+"&pic="+encodeURIComponent(imgurl)+"  title='分享到搜狐微博'"
				 +"class='jiathis_button_tsohu'  target='_blank'><span class='jiathis_txt jtico jtico_tsohu'></span></a>"
				 +"<a href=http://www.douban.com/recommend?title="+encodeURIComponent(title)+"&url="+encodeURIComponent(siteurl)+" title='分享到豆瓣'"
				 +"class='jiathis_button_douban'  target='_blank'><span class='jiathis_txt jtico jtico_douban'></span></a>"
				 +"<br><p class='fs-14 c-999'>把下面的内容发送给好友</p><p><textarea id='texts'  wrap='VIRTUAL' cols='65' rows='3'>"+
				 "我在"+sitetitle+"发布的消息："+title+"-"+siteurl+"</textarea></p>"
				 +"</div></div>" 
	/*		button: [{
	            value: '复制',
	            id: 'copy_botton',
	            callback: function () {
	            //	ZeroClipboard.setMoviePath( "/js/ZeroClipboard.swf" ); 
	            	var clip = new ZeroClipboard.Client(); 
	            	clip.setHandCursor( true );
	            	clip.setText("哈哈");
	            	clip.glue("copy-botton");
	                return false;
	            },
	            focus: true
	        }]*/
		});
	}

	//修改价格
	function updatePrice(orderid,manage) {
		if(manage==null){
			$action = "/company/order/updateprice/id/";
		}else{
			$action = "/manage/orderSale/updateprice/id/";//后台操作
		}
		$.getJSON($action+orderid, function(json){
				var str=cont = '';
				for( var i=1;i<json.product.length;i++){
					str += 	'<tr><td><input type="checkbox" name=""></td>'
								+'<td class="tl">'
								+'<p class="title_pro1"><a href="javascript:" title="">'+json.product[1].title+'</a></p>'
								+'<p class="other c_999"><span class="mr10">颜色：黑色</span><span>尺码：170/90(M)</span>'
								for(var j in json.product[i].spec){
									str +=	'<span class="mr10">'+j+'：'+json.product[0].spec[j]+'</span>'
								}	
					str +=		'</p>'
							+'</td>'
							+'<td>'+json.product[i].price+'</td><td>'+json.product[i].nums+'</td><td class="pro_sum_pri">'+json.product[i].sumprice+'</td>'
							+'<td><input class="t_ipt break" type="text" name="" value="10" maxlength="5" style="width:45px;">折='
								+'<input class="t_ipt pri" type="text" name="pro_price['+json.product[i].zop_id+']" value="'+json.product[i].sumprice+'" maxlength="10" style="width:45px;">'
							+'</tr>'
				}
					cont +=  '<form method="post" action="'+$action+orderid+'" id="updatepriceart" style="display: block; " class="boxy-content">'
									+'<div style="width:730px;" class="updtitle field">'
									+'<table class="list_table" cellpadding="0" cellspacing="0" width="100%"><tbody>'
									+'<tr><th><th class="tl">商品信息</th><th width="10%">单价(元)</th><th width="10%">数量</th><th width="10%">总价</th><th width="20%">涨价或折扣</th><th width="12%">邮费（元）</th></tr>'
									+'<tr><td><input type="checkbox" name=""></td>'
										+'<td class="tl">'
											+'<p class="title_pro1"><a href="javascript:" title="">'+json.product[0].title+'</a></p>'
											+'<p class="other c_999">'
											for(var i in json.product[0].spec){
												cont +=	'<span class="mr10">'+i+'：'+json.product[0].spec[i]+'</span>';
											}	
						cont +=				'</p>'
										+'</td>'
										+'<td>'+json.product[0].price+'</td><td>'+json.product[0].nums+'</td>'
										+'<td class="pro_sum_pri">'+json.product[0].sumprice+'</td>'
										+'<td><input class="t_ipt break" type="text" name="" value="10" maxlength="5" style="width:45px;">折='
											+'<input class="t_ipt pri" type="text" name="pro_price['+json.product[0].zop_id+']" value="'+json.product[0].sumprice+'" maxlength="10" style="width:45px;">'
										+'</td><td class="bd_l" rowspan="'+json.product.length+'">'
											+'<input class="t_ipt" type="text" id="freight" name="freight" value="'+json.freight+'" maxlength="5" style="width:55px;">'
										+'</td></tr>'
										+str
									+'</tbody></table>'
								+'</div><div class="sub c_f">'
									+'<div class="sub_l f_l">'
										+'<p>实付款：<span id="reality">'+json.reality+'</span>+<span id="dfreight">'+json.freight+'</span>-<span id="saving">0.00</span>=<strong class="fs_14 c_f60"><span id="sumprice">'+json.sumprice+'</span></strong>元</p>'
										+'<p>实付款= 原价+运费+涨价或折扣 </p>'
								+'</div></div></form>'
				art.dialog({
					title: '修改订单价格',
					fixed: true,
				    okValue:'确认',
				    cancelValue:'取消',
					content: cont,
				    ok: function () {
				        $("#updatepriceart").submit();
				        return false;
				    },
				    cancel: function () {
				    	return true;
				    }
				});
				
		});
		//修改价格量改变总价
		$('.break,.pri').live('change',function(){
			if($(this).parent().find('input').eq(0).val()>10||$(this).parent().find('input').eq(0).val()<1){
				alert("拆扣必需在1至10之间");
				return;
			}
			var spr = $(this).parent().prev('.pro_sum_pri').text();
			$(this).next('input').val(spr*$(this).val()/10);
			$(this).prev('input').val(($(this).val()/spr).toFixed(2));
			var reality = pro_sum_pri = 0;
			for(var i=0;i<$('.pri').length;i++){
				reality -= -$('.pri').eq(i).val();
			}
			for(var i=0;i<$('.pro_sum_pri').length;i++){
				pro_sum_pri -= -$('.pro_sum_pri').eq(i).text();
			}
			reality = reality.toFixed(2);//两位小数
			$('#reality').text(pro_sum_pri);//实付
			$('#dfreight').text($('#freight').val());//运费
			$('#sumprice').text(reality-(-$('#freight').val()));//总价
			$('#saving').text((pro_sum_pri-reality).toFixed(2));//优惠
		});
		//修改运费时修改总价
		$('#freight').live('change',function(){
			var reality = pro_sum_pri = 0
			for(var i=0;i<$('.pri').length;i++){
				reality -= -$('.pri').eq(i).val();
			}
			for(var i=0;i<$('.pro_sum_pri').length;i++){
				pro_sum_pri -= -$('.pro_sum_pri').eq(i).text();
			}
			reality = reality.toFixed(2);//两位小数
			$('#reality').text(pro_sum_pri);//实付
			$('#dfreight').text($('#freight').val());//运费
			$('#sumprice').text(reality-(-$('#freight').val()));//总价
			$('#saving').text((pro_sum_pri-reality).toFixed(2));//优惠
		});
	}